<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel = "stylesheet" href = "bootstrap/css/bootstrap.css" />
<link rel = "stylesheet" href = "bootstrap/css/style.css" />
<script type = "text/javascript" src = "bootstrap/js/jquery-1.11.0.min.js"></script>
<script type = "text/javascript" src = "bootstrap/js/bootstrap.js"></script>
<title>Permissions Page</title>
</head>
<body>
	<div class = "per">
		<div class = "row">
			<div class = "col-lg-10">
				<div class = "panel panel-success">
				<div class = "panel-heading"> <h4>Add/Edit/Delete Permission</h4></div>
					<div class = "panel-body">
						<center><img src = "bootstrap/images/logo_ibm.png" width = "90" height = "50"></center>
						<hr>
						
						<c:if test="${param.op == 'edit'}">
						<form action = "./EditPermissionServlet" method = "POST">
							<div class = "form-group">
								<input type = "text" name = "name" value = "${param.name}" class = "form-control">
							</div>
							<br/>
							<div class = "form-group">
								<textarea class="form-control" name = "description" rows="3">${param.desc}</textarea>
							</div>
							<br/><br/>
							<input type = "hidden" name = "id" value = "${param.id}">
							<input type = "submit" value = "Edit" class = "btn btn-success">
							<a class = "btn btn-danger" href = "index.jsp">Cancel</a>
						</form>
						</c:if>
						
						<c:if test = "${param.op == 'add'}">
							<form action = "./AddPermissionServlet" method = "POST">
							<div class = "form-group">
								<input type = "text" name = "name" class = "form-control">
							</div>
							<br/>
							<div class = "form-group">
								<textarea class="form-control" name = "description" rows="3"></textarea>
							</div>
							<br/><br/>
							<input type = "submit" value = "Add" class = "btn btn-success">
							<a class = "btn btn-danger" href = "index.jsp">Cancel</a>
						</form>
						</c:if>
						
						<c:if test = "${param.op == 'delete'}">
							<form action = "./DeletePermissionServlet" method = "POST">
							<div class = "form-group">
								<input type = "text" value = "${param.name}" class = "form-control" readonly>
							</div>
							<br/>
							<div class = "form-group">
								<textarea class="form-control" rows="3" readonly>${param.desc}</textarea>
							</div>
							<br/><br/>
							<label>Are You sure ?!</label><br/>
							<input type = "hidden" name = "id" value = "${param.id}">
							<input type = "submit" value = "Delete" class = "btn btn-success">
							<a class = "btn btn-danger" href = "index.jsp">Cancel</a>
						</form>
						</c:if>
						
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>